package com.yoomiito.app.adapter.home.nav;

import androidx.annotation.Nullable;
import android.widget.ImageView;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.yoomiito.app.R;
import com.yoomiito.app.model.bean.NavInfo;
import com.yoomiito.app.utils.ImageLoader;

import java.util.List;

public class NavGridAdapter extends BaseQuickAdapter<NavInfo, BaseViewHolder> {
    public NavGridAdapter( @Nullable List<NavInfo> data) {
        super(R.layout.item_goods_tab, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, NavInfo item) {
        ImageView iv = helper.getView(R.id.item_goods_tab_iv);
        TextView tv = helper.getView(R.id.item_goods_tab_tv);
        ImageLoader.getInstance().into(iv.getContext(),item.getIcon(),iv,R.drawable.goods_default);
        tv.setText(item.getName());
    }
}
